<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查询user</title>
</head>
<body>
  <a href="InsertUser.jsp" style="display:block;margin:0 auto;font-size:36px">增加user</a>
  <a href="SelectAllServlet?curpage=1" style="display:block;margin:0 auto;font-size:36px">查询user</a>
	<table>
	  <thead><th>ID</th><th>姓名</th><th>年龄</th><th>性别</th><th>操作</th></thead>
	  <tbody>
	  <c:forEach items="${requestScope.list }" var="item">
	  <tr>
	  <td>${item.id }</td>
	  <td>${item.name }</td>
	  <td>${item.age }</td>
	  <td><c:if test="${item.sex==0 }">女</c:if>
	      <c:if test="${item.sex==1 }">男</c:if>
	  </td>
	  <td><a href="SelectUserServlet?id=${item.id }">更新</a><a href="DeleteUserServlet?id=${item.id }">删除</a></td>
	  </tr>
	  </c:forEach>
	  </tbody>
	</table>
	<ul>
	<c:forEach begin="1" end="${requestScope.pageCount }" step="1" var="item">
		<c:if test="${item==requsetScope.curpage }">
			<li>第${item }页</li>
		</c:if>
		<c:if test="${item!=requsetScope.curpage }">
			<li><a href="SelectAllServlet?curpage=${item }">第${item }页</a></li>
		</c:if>
	</c:forEach>
	</ul>
</body>
</html>